package com.platform.enumeration;

import org.apache.commons.lang.StringUtils;

/**
 * @author gzg
 */

public enum NewsTypeEnum {
    /**
     * 受欢迎的类型美剧类
     */
    JOIN_TREASURE("1", "加盟宝典"),
    COMPANY_NEWS("2", "企业动态"),
    SHOP_FAIR("3", "开店捷报"),
    INVESTMENT_DYNAMICS("4", "招商动态");
    private String type;
    private String desc;

    NewsTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getNewsDescByType(String type) {
        for (NewsTypeEnum typeEnum : NewsTypeEnum.values()) {
            if (StringUtils.equals(type, typeEnum.getType())) {
                return typeEnum.getDesc();
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
